package com.itlong.cloud.enumerate.ecode;

import lombok.Getter;
import lombok.Setter;

/**
 * <desc>
 *    SDK服务端错误码定义.
 * </desc>
 *
 * @createDate 2017-09-21
 */
public enum SDKErrorCodeEnum {

    /*
    *mainCode为4表示SDK模块错误，subCode可用范围为1至999；
    */
    /*服务器端SDK错误信息  subCode可用范围为1~400*/
    SDK_SERVER_PROJECTNAME_IS_ILLEGAL(4,1,"申请的项目名称不合法"),
    SDK_SERVER_PROJECTNAME_IS_EXIST(4,2,"申请的项目名称已经存在，请换一个试试！"),
    SDK_SERVER_PROJECTID_IS_ILLEGAL(4,3,"传入项目编号不合法"),
    SDK_SERVER_CHECKDEVELOPER_AUTH(4,4,"没有权限"),
    SDK_SERVER_DEVELOP_IS_NULL(4,5,"开发者账号或密钥为空"),
    SDK_SERVER_DEVELOP_ERR(4,6,"开发者权限未开放，请联系客服"),
    SDK_SERVER_ENPUBKEY_USERID_IS_ILLEGAL(4,7,"encryptedKey或userId不合法"),
    SDK_SERVER_ADD_EQUIP_BUID(4,8,"至少添加一个楼栋地址"),
    SDK_SERVER_ADD_EQUIP_BUID_UNIT(4,9,"请检查设备类型和楼栋单元对应数目"),
    SDK_SERVER_ADD_EQUIP_NAME_IS_EXIST(4,10,"该名称的设备已经存在"),
    SDK_SERVER_ADD_DEVICEUNIQUE_IS_NOTEXIST(4,11,"所修改的设备唯一码不存在"),
    SDK_SERVER_IP_BINDING_ERR(4,12,"您的IP没有进行绑定"),
    SDK_SERVER_MAC_BINDING_ERR(4,13,"您的MAC没有进行绑定"),
    SDK_SERVER_NO_DEVICE_UNIQUE_ERR(4,14,"您没有拥有该设备序列号的权限"),
    SDK_SERVER_EFFECTIVE_TIME_OUT_ERR(4,15,"时长应在0到99之间"),
    SDK_SERVER_TIME_OUT_ERR(4,16,"开门时长应在0到300之间"),
    SDK_PARAM_TOKEN_ERR(4,17,"token为空或有误,请重新认证"),
    SDK_PARAM_APPID_APPSECRET_ERR(4,18,"开发者账号或密钥有误"),
    SDK_RATE_LIMIT_ERR(4,19,"系统繁忙请稍后重试"),
    SDK_FACE_API_AUTHORITY_ERR(4,20,"您没有人脸识别API业务的权限"),
    SDK_INPUT_PARAM_ERR(4,21,"入参信息格式不正确"),
    SDK_ROBOT_CALL_ELEVATOR_RECORD_ERR(4,22,"当前机器人呼梯行程未完成"),
    SDK_ROBOT_CALL_ELEVATOR_BUSY_ERR(4,23,"当前机器人开门过于频繁"),
    SDK_DEVELOPER_PROJECT_IS_NULL(4,24,"项目参数不能为空"),
    SDK_DEVICE_NOT_SUPPORT_THIS_FUNCTIONS(4,25,"当前设备不支持此功能"),
    SDK_DEVELOPER_STATUS_ERR(4,26,"开发者已禁用"),
    SDK_FACE_API_VISITOR_TIME_ERR(4,27,"访客有效时间不能超过1440分钟"),
    SDK_VISITOR_NAME_ERR(4,28,"访客及被拜访人的姓名长度不能超过32位"),
    SDK_DEVICE_DATA_ERROR(4,29,"设备数据异常"),
    SDK_IOT_DATA_ERROR(4,30,"iot数据异常"),
    SDK_NONE_CLOUD_ENTRANCE_AUTH_ERR(4,31,"无云门禁云对接权限"),
    SDK_NONE_MULTI_CLOUD_ELEVATOR_AUTH_ERR(4,31,"无多梯自动调度云对接权限"),
    SDK_NONE_SINGLE_CLOUD_ELEVATOR_AUTH_ERR(4,31,"无单梯云对接权限"),
    SDK_SERVER_ROOMID_ERR(4,32,"您所传入房间ID有误，请核查"),
    /*APP端SDK错误信息  subCode可用范围为401~800*/
    SDK_APP_LOGINDEVICE_NOT_NULL(4,201,"登录设备不能为空"),
    ;

    @Setter
    @Getter
    private ErrorCode errorCode = new ErrorCode();  //错误码信息


    /**
     * <desc>
     *    无参构造函数.
     * </desc>
     *
     * @author LewisLouis
     * @createDate 2017-09-21
     */
    SDKErrorCodeEnum(){}

    /**
     * <desc>
     *    主错误码与错误信息构造函数.
     * </desc>
     *
     * @param mainCode 主错误码
     * @param codeMsg 错误信息
     * @author LewisLouis
     * @createDate 2017-09-21
     */
    SDKErrorCodeEnum(Integer mainCode, String codeMsg) {
        errorCode.setMainCode(mainCode);
        errorCode.setSubCode(0);
        errorCode.setCodeMsg(codeMsg);
    }

    /**
     * <desc>
     *    全参构造函数.
     * </desc>
     *
     * @param mainCode 主错误码
     * @param subCode 子错误码
     * @param codeMsg 错误信息
     * @author LewisLouis
     * @createDate 2017-09-21
     */
    SDKErrorCodeEnum(Integer mainCode, Integer subCode, String codeMsg){
        errorCode.setMainCode(mainCode);
        errorCode.setSubCode(subCode);
        errorCode.setCodeMsg(codeMsg);
    }
}
